package com.modudf.service;

import com.modudf.common.Page;
import com.modudf.domain.MaskInfo;
import com.modudf.exception.SystemError;
import com.modudf.persist.MaskDaoImpl;

public class MaskInfoManagerImpl implements MaskInfoManager {

	private static MaskInfoManager manager = new MaskInfoManagerImpl();
	
	public static MaskInfoManager getInstance() {
		return manager;
	}
	
	@Override
	public void addMaskInfo(MaskInfo maskInfo) {
		try {
			MaskDaoImpl.getInstance().addMaskInfo(maskInfo);
		} catch (Exception e) {
			throw new SystemError(e.getMessage());
		}
	}

	@Override
	public Page findAllMaskInfo(String keyword, int pageIndex) {
		try {
			return MaskDaoImpl.getInstance().findAllMaskInfo(keyword, pageIndex);
		} catch (Exception e) {
			throw new SystemError(e.getMessage());
		}
	}

	@Override
	public void deleteMaskInfo(int mid) {
		try {
			MaskDaoImpl.getInstance().deleteMaskInfo(mid);
		} catch (Exception e) {
			throw new SystemError(e.getMessage());
		}
	}

	@Override
	public MaskInfo findMaskInfo(int mid) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public void updateMaskInfo(MaskInfo maskInfo) {
		try {
			MaskDaoImpl.getInstance().updateMaskInfo(maskInfo);
		} catch (Exception e) {
			throw new SystemError(e.getMessage());
		}
	}

}
